package com.ruoyi.rural.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.rural.mapper.RuralUserHouseMapper;
import com.ruoyi.rural.domain.RuralUserHouse;
import com.ruoyi.rural.service.IRuralUserHouseService;

/**
 * 用户房屋关联Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-02-06
 */
@Service
public class RuralUserHouseServiceImpl implements IRuralUserHouseService 
{
    @Autowired
    private RuralUserHouseMapper ruralUserHouseMapper;

    /**
     * 查询用户房屋关联
     * 
     * @param id 用户房屋关联主键
     * @return 用户房屋关联
     */
    @Override
    public RuralUserHouse selectRuralUserHouseById(String id)
    {
        return ruralUserHouseMapper.selectRuralUserHouseById(id);
    }

    /**
     * 查询用户房屋关联列表
     * 
     * @param ruralUserHouse 用户房屋关联
     * @return 用户房屋关联
     */
    @Override
    public List<RuralUserHouse> selectRuralUserHouseList(RuralUserHouse ruralUserHouse)
    {
        return ruralUserHouseMapper.selectRuralUserHouseList(ruralUserHouse);
    }

    /**
     * 新增用户房屋关联
     * 
     * @param ruralUserHouse 用户房屋关联
     * @return 结果
     */
    @Override
    public int insertRuralUserHouse(RuralUserHouse ruralUserHouse)
    {
        ruralUserHouse.setCreateTime(DateUtils.getNowDate());
        return ruralUserHouseMapper.insertRuralUserHouse(ruralUserHouse);
    }

    /**
     * 修改用户房屋关联
     * 
     * @param ruralUserHouse 用户房屋关联
     * @return 结果
     */
    @Override
    public int updateRuralUserHouse(RuralUserHouse ruralUserHouse)
    {
        ruralUserHouse.setUpdateTime(DateUtils.getNowDate());
        return ruralUserHouseMapper.updateRuralUserHouse(ruralUserHouse);
    }

    /**
     * 批量删除用户房屋关联
     * 
     * @param ids 需要删除的用户房屋关联主键
     * @return 结果
     */
    @Override
    public int deleteRuralUserHouseByIds(String[] ids)
    {
        return ruralUserHouseMapper.deleteRuralUserHouseByIds(ids);
    }

    /**
     * 删除用户房屋关联信息
     * 
     * @param id 用户房屋关联主键
     * @return 结果
     */
    @Override
    public int deleteRuralUserHouseById(String id)
    {
        return ruralUserHouseMapper.deleteRuralUserHouseById(id);
    }
}
